﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _0517
{
    public partial class frmSer : Form
    {
        public frmSer()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmMain fm = new frmMain();
            fm.Activate();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label5.Text = "";
            label9.Text = "";
            label10.Text = "";
            label11.Text = "";
            richTextBox1.Clear();
            richTextBox2.Clear();
            label15.Text = "";
            label16.Text = "";
            label17.Text = "";
            label18.Text = "";
            label20.Text = "";
            label22.Text = "";

        }

        private void frmSer_Load(object sender, EventArgs e)
        {
            label5.Text = _0517病例系统.chaxun.b;
            label9.Text = _0517病例系统.chaxun.n;
            label10.Text = _0517病例系统.chaxun.p;
            label11.Text = _0517病例系统.chaxun.y;
            label15.Text = _0517病例系统.yao.nn;
            label16.Text = _0517病例系统.jiancha.cc;
            label17.Text = _0517病例系统.jianyan.yan;
            label18.Text = _0517病例系统.yao.gg;
            label20.Text = _0517病例系统.jiancha.hh;
            label22.Text = _0517病例系统.jianyan.jj;


        }

        private void button7_Click(object sender, EventArgs e)
        {
            this.Hide();
            _0517病例系统.chaxun x = new _0517病例系统.chaxun();
            x.Show();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.Hide();
            _0517病例系统.yao yy = new _0517病例系统.yao();
            yy.Show();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            this.Hide();
            _0517病例系统.jiancha jj = new _0517病例系统.jiancha();
            jj.Show();

        }

        private void button6_Click(object sender, EventArgs e)
        {
            this.Hide();
            _0517病例系统.jianyan aa = new _0517病例系统.jianyan();
            aa.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {


            MessageBox.Show("保存成功");
            this.Hide();

            string strSql;
            _0517病例系统.DataAccess data = new _0517病例系统.DataAccess();
            strSql = "insert into chuangjianss(编号,姓名,电话,年龄,主诉,诊断,药品项目,药品价格,检查项目,检查价格,检验项目,检验价格) values('" + label5.Text + "','" + label9.Text + "','" + label10.Text + "','" + label11.Text + "','" + richTextBox1.Text + "','" + richTextBox2.Text + "','" + label15.Text + "','" + label18.Text + "','" + label16.Text + "','" + label20.Text + "','" + label17.Text + "','" + label22.Text + "')";
            data.dataCon();
            if (data.sqlExec(strSql))
            {
                MessageBox.Show("保存成功！");
                this.Hide();

            }
            else
            {
                MessageBox.Show("保存失败！");
            }
        }
    }
}
